package com.foxmail.aroundme.mutlitype.footer_header;

import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.foxmail.aroundme.mutlitype.ItemViewProvider;
import com.foxmail.aroundme.mutlitype.R;

/**
 * Created by gzl on 1/23/17.
 *
 * footer
 */

public class HeaderProvider extends ItemViewProvider<HeaderItem, HeaderViewHolder>{
    @NonNull
    @Override
    protected HeaderViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {

        View view = inflater.inflate(R.layout.item_defaule_header_footer, parent, false);

        return new HeaderViewHolder(view);
    }

    @Override
    protected void onBindViewHolder(@NonNull HeaderViewHolder holder, @NonNull HeaderItem headerItem) {
        holder.tv_content.setText(headerItem.headerContent);
        holder.tv_content.setTextColor(headerItem.textColor);
        holder.frameLayout.setBackgroundColor(headerItem.bgColor);
    }
}
